package com.hotpot.common.plugin.schedulers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class TestScheduler {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
      
    @Scheduled(cron="0 0 * * * ?") //每秒执行一次
    public void statusCheck() {      
        logger.info("每分钟执行一次。开始……");
        //statusTask.healthCheck();  
        logger.info("每分钟执行一次。结束。");  
    }    
  
    @Scheduled(cron="0 0 0 * * ?")
    public void testTasks() {      
        logger.info("每20秒执行一次。开始……");  
        //statusTask.healthCheck();  
        logger.info("每20秒执行一次。结束。");  
    }    
}  